Microcontrollers are well known in the electronic design industry, and include the MCS®51 microcontroller family, available for many years from Intel®, Santa Clara, Calif. An overview of the basic architecture and features of this microcontroller family is provided in “An Introduction to the Intel® MCS®51 Single-Chip Microcomputer Family,” Application Note AP-69, by John Wharton, May 1980, which is hereby incorporated herein by reference. Additional features and capabilities, such as faster speed, more memory and programmable counter arrays, have been introduced to the MCS®51 family since this application note was written, although the primary functionality is still relatively the same.
Generally, a microcontroller has a standard hardware design that is customized for a particular implementation by programming the firmware for a specific application. Microcontrollers thus generally have the advantage of combining relatively inexpensive, generic hardware with specialized firmware to provide cost-effective custom designs for many different applications. Furthermore, modifications and improvements may be made, even after a product has been sold, simply by reprogramming the device.
The architecture of specific microcontrollers can vary from manufacturer to manufacturer, and from product to product. For example, a microcontroller integrated circuit (“IC”) may consist essentially of a microprocessor or central processing unit (“CPU”), or a microcontroller may comprise a microprocessor plus on-chip memory and peripherals, such as timers, counters, and serial ports.
Generally, while a microcontroller reduces the cost of and shortens the time it takes to design, debug and manufacture a specialized integrated circuit, the firmware which controls the operation of a microcontroller is specialized and must itself be designed and debugged for each application. Typically, the firmware is developed and first tested on a simulator before being run in the microcontroller. In a simulation, the architecture of the microcontroller is simulated on a host computer, and the firmware written in the instruction set of the microcontroller is executed on the host computer. The simulator allows the developer to debug the firmware by monitoring the firmware's execution, viewing the values in registers and memory, displaying the microcontroller's status. The developer may also single step the firmware, or set breakpoints to halt execution of the firmware upon detection of a specific event, such as the access of a particular memory location.
One disadvantage to using a simulator is that the hardware, including the microcontroller, is simulated on the host system, and it is difficult to precisely simulate the hardware in the actual product, and all of the events that will occur in using the actual product. Therefore the firmware may also be debugged using an emulator, in which the actual product hardware is tested, except for the microcontroller IC itself. Generally, an emulator replaces the microcontroller IC in the product with a connector that plugs into the socket for the microcontroller, providing an interface to a development system that emulates the microcontroller. An emulator has the advantage over a simulator of being able to test the firmware in the environment of the actual product or at least a prototype of the product, while retaining the monitoring and control functions of the development system.
For example, a program can be executed step by step while the status is monitored, or break points may be used, as with a simulator. In addition, the microcontroller's interface to the other hardware in the actual product may be tested, providing a more realistic test environment than with a simulator. After debugging the firmware with an emulator, the firmware may be loaded into the memory (e.g., ROM or RAM) of the microcontroller and run through final testing.
One problem with microcontrollers, however, is that they are often used in embedded systems in which it is difficult to gain access to the microcontroller external signals. Thus it may be impossible or impractical to substitute an external emulator for the microcontroller IC to debug the firmware.
Another problem with microcontrollers is that some use non-standard hardware, or have hardware that may be configured by the user, and an external microcontroller emulator may not be available for debugging a non-standard microcontroller.
Another disadvantage with prior art emulators is that they are typically expensive, and an emulator may not be available for debugging a particular developer's firmware. Also, an emulator may be available for a project, but may not be available to test a microcontroller located in the field or at a remote site.